<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=
    , initial-scale=1.0">
    <title>Document</title>
</head>
<br>
    <img id="hi" src="https://www.w3schools.com/w3images/mountains.jpg" alt="Mountains"><br><br>
    <div class ='cls'>  传智教育</div><br>
    <div class ='cls'>  传智播客</div><br>
<input type ='checkbox' name="'hobby">电影
<input type ='checkbox' name="'hobby">音乐
<input type ='checkbox' name="'hobby">旅游

</body>
<script>
    // 换图片
    var img = document.getElementById("hi");
    img.src="https://www.w3schools.com/w3images/nature.jpg";
    //在数组加上字
    var divs = document.getElementsByTagName("div");
    for(let i=0;i<divs.length;i++)
    {
        const div =divs[i];
        // 调用div的属性
        div.innerHTML +="<font color='red'> very good</font>";
        }

    // 选中复选框
    var checkboxs = document.getElementsByName('hobby');
    for(let i=0;i<checkboxs.length;i++)
    {
        const check =checkboxs[i];
        check.checked = true;
        }



</script>
</html>